<?php
/**
 * 初始化工作
 * 
 * PHP Version 5.6
 *
 * @category PHP
 * @package  TelegramPostBot
 * @author   ctwj <908504609@qq.com>
 * @license  MIT https://mit-license.org/
 * @link     MIT https://mit-license.org/
 * @date     2018-05-13 22:56:47
 * @modifyby ctwj
 */

define('ROOT', dirname(__FILE__));
define('D', DIRECTORY_SEPARATOR);
define('SRC_ROOT', ROOT.D.'src/');

require_once ROOT.DS.'vendor/autoload.php';

$dotenv = new Dotenv\Dotenv(SRC_ROOT);
$dotenv->overload();

return [
    'paths'=>[
        'migrations'=> ROOT.D.'src'.D.'database'.D.'migrations',
        'seeds'     => ROOT.D.'src'.D.'database'.D.'seeds'
    ],
    'environments'  => [
        'default_migration_table'   => 'phinxlog',
        'default_databases'         => getenv('DB_NAME'),
        'default_enviroment'        => 'development',
        'development'   => [
            "adapter"   => getenv('DATABASE_TYPE'),
            "host"      => getenv('DB_HOST'),
            "name"      => getenv('DB_NAME'),
            "user"      => getenv('DB_USER'),
            "pass"      => getenv('DB_PASS'),
            "port"      => getenv('DB_NAME'),
            "charset"   => "utf8"
        ],
        'production'  => [
            "adapter"   => getenv('DATABASE_TYPE'),
            "host"      => getenv('DB_HOST'),
            "name"      => getenv('DB_NAME'),
            "user"      => getenv('DB_USER'),
            "pass"      => getenv('DB_PASS'),
            "port"      => getenv('DB_NAME'),
            "charset"   => "utf8"
        ]
    ]
];